import request from '@/utils/request'

// 获取房产列表
export const getPropertyList = (params) => request({
  url: '/properties',
  params
})

// 获取房产数量
export const getPropertyNum = params => request({
  url: '/properties/count',
  params
})

// 根据id获取指定房产
export const getPropertyById = id => request({
  url: '/properties/' + id
})

// 编辑房产
export const editProperty = data => request({
  url: '/properties/' + data.id,
  method: 'put',
  data
})

// 新建房产
export const addProperty = data => request({
  url: '/properties',
  method: 'post',
  data
})

// 删除房产
export const delProperty = id => request({
  url: '/properties/' + id,
  method: 'delete'
})

